<template>
  <a-input v-model:value="value" @change="change" />
</template>

<script>
import { reactive, toRefs } from '@vue/reactivity';
import { getCurrentInstance } from '@vue/runtime-core';

export default {
    props:{
        val:{
            type:String,
            required:true
        }
    },
  setup() {
    const state = reactive({
        value:""
    })

    let {proxy} = getCurrentInstance()

    const change = (val)=>{
        proxy.$emit("update:val",val)
    }
    
    return {
      ...toRefs(state),
      change
    };
  },
};
</script>

<style>
</style>